<template>
  <div>
    <el-breadcrumb separator="/" style="padding-left:10px;padding-bottom:10px;font-size:12px;">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>{{ this.$router.currentRoute.name }}</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card>
      <el-page-header @back="goBack"
                      :content="this.$router.currentRoute.name.substring(this.$router.currentRoute.name.indexOf('/')+1)">
      </el-page-header>
      <!-- 系统通知列表卡片区 -->
      <el-form :inline="true" ref="form" size="small" style="margin-top: 2vh">
        <el-row>
          <h4 style="margin: 1vh 0 2vh;color: #1f2d3d">条件查询区</h4>
        </el-row>
        <el-form-item>
          <el-select
              clearable
              style="width: 140px;"
              placeholder="请选择账号"
              v-model="queryMap.accountName"
              @change="handleChange"
              filterable

          >
            <el-option label="全部" value=""></el-option>
            <el-option
                v-for="(name) in accountName"
                :key="name"
                :label="name"
                :value="name">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-input
              style="width: 140px;"
              clearable
              placeholder="请输入客户名称"
              v-model="queryMap.resourceName"
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-select
              clearable
              style="width: 120px;"
              placeholder="请选择标签"
              v-model="queryMap.resourceTag"
          >
            <el-option label="全部" value="-1"></el-option>
            <el-option label="未标记" value="0"></el-option>
            <el-option label="无效" value="1"></el-option>
            <el-option label="待定" value="2"></el-option>
            <el-option label="有效" value="3"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-input
              style="width: 150px;"
              clearable
              placeholder="请输入联系人名称"
              v-model="queryMap.linkman"
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-input
              style="width: 130px;"
              clearable
              placeholder="请输入电话"
              v-model="queryMap.phoneA"
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-select
              clearable
              style="width: 140px;"
              placeholder="请选择行业类别"
              v-model="queryMap.industryId"
          >
            <el-option label="全部" value=""></el-option>
            <el-option v-for="dept in IndustryVOs" :label="dept.options" :value="dept.industryId">

            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-select
              clearable
              style="width: 140px;"
              placeholder="请选择客户种类"
              v-model="queryMap.clientTypeId"
          >
            <el-option label="全部" value=""></el-option>
            <el-option v-for="dept in clienttypeList" :label="dept.options" :value="dept.clientTypeId">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-select clearable v-model="queryMap.userId" style="width: 140px;" filterable placeholder="请选择归属人">
            <el-option label="全部" value="-1"></el-option>
            <el-option
                v-for="item in options_user"
                :key="item.userId"
                :label="item.userName+'('+item.nickName+')'"
                :value="item.userId">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-select clearable v-model="queryMap.createUserId" style="width: 140px;" filterable placeholder="请选择创建人">
            <el-option label="请选择创建人" value="-1"></el-option>
            <el-option
                v-for="item in createuserList"
                :key="item.userId"
                :label="item.userName+'('+item.nickName+')'"
                :value="item.userId">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-select
              clearable
              style="width: 140px;"
              placeholder="是否呼叫"
              v-model="queryMap.isCall"
          >
            <el-option label="全部" value=""></el-option>
            <el-option label="未呼叫" value="0"></el-option>
            <el-option label="已呼叫" value="1"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="时间筛选:">
          <el-select
              clearable
              style="width: 120px;"
              v-model="queryMap.time"
              placeholder="请选择时间"
          >
            <el-option label="创建时间" value="1"></el-option>
            <el-option label="呼叫时间" value="2"></el-option>
            <el-option label="更新时间" value="3"></el-option>
          </el-select>
          <el-date-picker
              v-model="value2"
              type="daterange"
              align="right"
              unlink-panels
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              :picker-options="pickerOptions">
          </el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button @click="reset" icon="el-icon-refresh">重置</el-button>
          <el-button @click="searchHighSeasClient" type="primary" icon="el-icon-search">查询</el-button>
        </el-form-item>
      </el-form>

      <div style="margin-bottom: 10px;display: flex">
        <span class="hint" style="flex: 1;"></span>
        <el-button style="" v-hasPermission="'HigSeas_Client:delete'" @click="batchTransferToOpenSea()"
                   icon="el-icon-delete">批量删除
        </el-button>
        <el-button style="" v-hasPermission="'HigSeas_Client:transform'" @click="batchTransform()" icon="el-icon-user">
          批量转为普通客户
        </el-button>
        <el-button style="" v-hasPermission="'HigSeas_Client:export'" @click="batchExportExcel()"
                   icon="el-icon-download">批量导出
        </el-button>
<!--        <el-button style="" v-hasPermission="'HigSeas_Client:excelAll'" @click="downExcelAll()" icon="el-icon-download">-->
<!--          全部导出-->
<!--        </el-button>-->
      </div>
      <!-- 表格区域 -->
      <el-table ref="multipleTable" :data="Data" size="small" @selection-change="handleSelectionChange"
                border style="width: 100%;" height="420">
        <el-table-column type="selection" width="40"></el-table-column>
        <el-table-column prop="accountName" label="归属账号" fixed="left" width="150"></el-table-column>
        <el-table-column prop="resourceName" label="客户名称" fixed="left" width="100"></el-table-column>
        <el-table-column prop="linkman" label="联系人" width="100"></el-table-column>
        <el-table-column prop="phoneA" label="电话A" width="200"></el-table-column>
        <el-table-column prop="phoneB" label="电话B" width="200"></el-table-column>
        <el-table-column prop="isCall" label="是否呼叫" width="100">
          <template v-slot="scope">
            <span>{{ showCall(scope.row) }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="clientTypeOptions" label="客户种类" width="100"></el-table-column>
        <el-table-column prop="lifeCycle" label="生命周期" width="100">
          <template v-slot="scope">
            <span>{{ showLifeCycle(scope.row) }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="sourceOptions" label="客户来源" width="100"></el-table-column>
        <el-table-column prop="industryOptions" label="行业类型" width="100"></el-table-column>
        <el-table-column prop="userName" label="所属人" width="100"></el-table-column>
        <el-table-column prop="lastCallTime" label="最后呼叫时间" width="100"></el-table-column>
        <el-table-column label="操作" fixed="right" width="120">
          <template v-slot="scope">
            <el-tooltip content="转为普通客户" placement="top" effect="light">
              <el-button v-hasPermission="'HigSeas_Client:transform'" @click="transform(scope.row.resourceId)"
                         type="primary" size="small" icon="el-icon-user" plain circle></el-button>
            </el-tooltip>
            <el-tooltip content="删除" placement="top" effect="light">
              <el-button v-hasPermission="'HigSeas_Client:delete'"
                         @click="deleteHighSeasClientById(scope.row.resourceId)" type="danger" size="small"
                         icon="el-icon-delete" plain circle></el-button>
            </el-tooltip>
          </template>
        </el-table-column>
      </el-table>

      <!-- 分页 -->
      <el-pagination
          style="margin-top:10px;"
          background
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="queryMap.pageNum"
          :page-sizes="[6, 10, 20, 30,50,100,300,500]"
          :page-size="queryMap.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
      ></el-pagination>

    </el-card>
  </div>
</template>
<script>
import axios from "axios";
import ElectUsersBox from "@/components/electUsersBox.vue";

export default {
  components: {ElectUsersBox},
  data() {
    return {
      total: 0,
      Data: [],
      value2: '',//日期选择器
      IndustryVOs: [],
      clienttypeList: [],
      options_user: [],
      multipleSelection: [],
      accountName:[],
      createuserList: [],
      //查询对象
      queryMap: {
        time: '1',
        accountName:"",
        pageNum: 1,
        pageSize: 6,
        userName: "",
        userId: "",
        nickName: "",
        resourceTag: "",
        createUserName: "",
        createUserId: "",
        clientTypeId:"",
        industryId: "",
      },
      updateForm: {},

      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
            picker.$emit('pick', [start, end]);
          }
        }]
      },
    };
  },
  methods: {
    //重置
    reset() {
      this.queryMap = {
        time: '1',
        pageNum: 1,
        pageSize: 6,
        userName: "",
        userId: "",
        nickName: "",
        resourceTag: "",
        industryId:"",
        clientTypeId:"",
        createUserName: "",
        createUserId: "",
        accountName: "",
      }
      this.defaultTime();
      this.findHighSeasClient();
    },
    /**
     * 获得账号信息
     */
    async getAccountNameList() {
      const {data: res} = await this.$http.get("/system/user/qt/findRoleList");
      if (!res.success) {
        return this.$message.error("获取角色信息失败:" + res.data.errorMsg);
      }
      this.accountName = res.data

    },
    handleChange() {
      this.queryMap.industryId = "";
      this.queryMap.userId = "";
      this.queryMap.clientTypeId = "";
      this.queryMap.createUserId = "";


      this.getAllIndustryList();
      this.selectUser();
      this.findClienttypeList();
      this.findCreateUsersList();
    },
    /**
     * 加载行业类型列表
     */
    async getAllIndustryList() {
      this.loading = true;

      try {
        const { data: res } = await this.$http.get("/resourceInfo/findIndustryVOList", {
          params: {accountName:this.queryMap.accountName}
        });
        let validData = [];
        if (Array.isArray(res)) {
          validData = res;
        } else if (typeof res === 'object' && res.success) {
          validData = res.data || [];
          console.log("aaaaaa"+validData)
        }
        if (Array.isArray(validData)) {
          this.IndustryVOs = validData.map(item => ({
            industryId: item.industryId,
            options: item.options
          }));
        }
      } catch (error) {
        // 处理其他异常
        console.error('获取行业类型列表时遇到异常', error);
        this.$message.error('获取行业类型列表时遇到异常');
      }
    },
    /**
     * 加载客户类型列表
     */
    async findClienttypeList() {
      this.loading = true;
      try {
        const { data: res } = await this.$http.get("/resourceInfo/findClienttypeList",{
          params: {accountName:this.queryMap.accountName}
        });
        console.log('获取客户类型列表响应数据:', res);
        let validData = [];
        if (Array.isArray(res)) {
          validData = res;
        } else if (typeof res === 'object' && res.success) {
          validData = res.data || [];
        }
        if (Array.isArray(validData)) {
          this.clienttypeList = validData.map(item => ({
            clientTypeId: item.clientTypeId,
            options: item.options
          }));
        }
      } catch (error) {
        // 处理其他异常
        console.error('获取客户类型列表时遇到异常', error);
        this.$message.error('获取客户类型列表时遇到异常');
      }
    },
    //加载创建人列表
    async findCreateUsersList() {
      const {data: res} = await this.$http.post("/system/departmentUtils/getUserListByMap/", {
        accountName:this.queryMap.accountName
      });
      if (res.success) {
        this.createuserList = res.data;
      } else {
        return this.$message.error("系统通知信息编辑失败:" + res.message);
      }
    },
    //加载公海列表
    async findHighSeasClient() {
      this.loading = true;
      try {
        const res = await this.$http.get("/highSeasClient/findHighSeasClient", {
          params: this.queryMap
        });
        if (!res.data.success) {
          this.$message.error("获取资源列表失败:" + res.data.data.errorMsg);
        } else {
          if (res.data && res.data.data && typeof res.data.data.total === 'number' && Array.isArray(res.data.data.rows)) {
            this.total = res.data.data.total;
            this.Data = res.data.data.rows;
          } else {
            this.$message.error("获取的资源列表数据格式不正确");
          }
        }
      } catch (error) {
        console.error("获取资源列表时出错", error);
        this.$message.error("获取资源列表时出现未知错误，请稍后重试");
      } finally {
        this.loading = false;
      }
    },


    //删除资源
    async deleteHighSeasClientById(id) {
      this.loading = true;
      const confirm = await this.$confirm(
          "此操作将把该资源删除到回收站, 是否继续?",
          "提示",
          {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }
      ).catch(() => {
        this.$message({
          type: "info",
          message: "已取消删除操作"
        });
      });
      if (confirm === "confirm") {
        try {
          const res = await this.$http.get("/highSeasClient/deleteHighSeasClientById", {
            params: {
              id: id
            }
          });
          // 假设后端返回1表示成功，其他值表示失败
          if (res.data === 1) {
            this.$message.success('资源删除成功');
            // 重新获取资源列表，以显示更新后的数据
            await this.findHighSeasClient();
          } else {
            this.$message.error('资源删除失败');
          }
        } catch (error) {
          console.error('删除资源信息时出错', error);
          this.$message.error('删除资源信息时遇到异常，请检查网络或联系管理员');
        } finally {
          this.loading = false;
        }
      }
    },
    //批量删除
    async batchTransferToOpenSea() {
      if (this.multipleSelection.length === 0) {
        return this.$message.warning('请至少选择一条记录');
      }
      this.loading = true;
      const confirm = await this.$confirm(
          "此操作将把选中的公海客户删除到回收站, 是否继续?",
          "提示",
          {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }
      ).catch(() => {
        this.$message({
          type: "info",
          message: "已取消删除操作"
        });
      });
      if (confirm) {
        try {
          const promises = this.multipleSelection.map(row => {
            return this.$http.get("/highSeasClient/deleteHighSeasClientById", {
              params: {id: row.resourceId}
            });
          });
          const results = await Promise.allSettled(promises);
          let successCount = 0;
          results.forEach(result => {
            if (result.status === 'fulfilled' && result.value.data > 0) {
              successCount++;
            }
          });
          if (successCount === this.multipleSelection.length) {
            this.$message.success('全部成功删除到回收站');
          } else if (successCount > 0) {
            this.$message.success(`${successCount} 条公海客户资源已成功删除到回收站，部分记录失败`);
          } else {
            this.$message.error('批量转入公海失败');
          }
          await this.findHighSeasClient();
        } catch (error) {
          console.error('批量删除时出错', error);
          this.$message.error('批量删除时遇到异常，请检查网络或联系管理员');
        } finally {
          this.loading = false;
        }
      }
    },
    //将公海客户转化为普通客户
    async transform(id) {
      this.loading = true;
      const confirm = await this.$confirm(
          "此操作将把该公海客户转化为普通客户, 是否继续?",
          "提示",
          {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }
      ).catch(() => {
        this.$message({
          type: "info",
          message: "已取消操作"
        });
      });

      if (confirm === "confirm") {
        try {
          const res = await this.$http.get("/highSeasClient/transform", {
            params: {
              id: id
            }
          });
          // 假设后端返回的是一个包含所有操作结果的Map
          const resultMap = res.data;
          // 判断整体结果
          if (resultMap.overallResult === 1) {
            this.$message.success('客户转化成功');
            // 重新获取资源列表，以显示更新后的数据
            await this.findHighSeasClient();
          } else {
            // 如果整体失败，根据具体失败的操作显示错误信息
            let errorMessage = '客户转化失败，原因：';

            // 检查是否超出公海客户限制
            if (resultMap.isExceedHighSeasClien !== 1) {
              errorMessage += '超出公海客户限制；';
            } else {
              // 如果没有超出限制，再检查其他操作的结果
              if (resultMap.updateUserId !== 1) {
                errorMessage += '更新用户ID失败；';
              }
              if (resultMap.deleteHighSeasClientById !== 1) {
                errorMessage += '删除公海客户失败；';
              }
              if (resultMap.usersHighSeasCountAccumulate !== 1) {
                errorMessage += '累计用户公海客户数量失败；';
              }
            }
            this.$message.error(errorMessage);
            await this.findHighSeasClient();
          }
        } catch (error) {
          console.error('客户转化信息时出错', error);
          this.$message.error('客户转化信息时遇到异常，请检查网络或联系管理员');
        } finally {
          this.loading = false;
        }
      }
    },
    //批量将客户转化为普通客户
    async batchTransform() {
      if (this.multipleSelection.length === 0) {
        return this.$message.warning('请至少选择一条记录');
      }
      this.loading = true;
      const confirm = await this.$confirm(
          "此操作将把选中的公海客户转化为普通客户, 是否继续?",
          "提示",
          {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }
      ).catch(() => {
        this.$message({
          type: "info",
          message: "已取消把选中的公海客户转化为普通客户操作"
        });
      });
      if (confirm) {
        try {
          let successCount = 0;
          for (const row of this.multipleSelection) {
            try {
              const result = await this.$http.get("/highSeasClient/transform", {
                params: {id: row.resourceId}
              });
              if (result.data.overallResult === 1) {
                successCount++;
              }
            } catch (error) {
              console.error('单个公海客户转化为普通客户失败', error);
            }
          }
          if (successCount === this.multipleSelection.length) {
            this.$message.success('全部成功把选中的公海客户转化为普通客户');
          } else if (successCount > 0) {
            this.$message.success(`${successCount} 条公海客户资源已成功转化为普通客户，部分记录失败`);
          } else {
            this.$message.error('批量转入公海失败');
          }
          await this.findHighSeasClient();
        } catch (error) {
          console.error('批量公海客户转化为普通客户', error);
          this.$message.error('批量公海客户转化为普通客户遇到异常，请检查网络或联系管理员');
        } finally {
          this.loading = false;
        }
      }
    },
    //全选功能
    toggleSelection(rows) {
      if (rows) {
        rows.forEach(row => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
      console.log("******************************", val);
    },
    //改变页码
    handleSizeChange(newSize) {
      this.queryMap.pageSize = newSize;
      this.findHighSeasClient();
    },
    //翻页
    handleCurrentChange(current) {
      this.queryMap.pageNum = current;
      this.findHighSeasClient();
    },
    //搜索系统通知
    async searchHighSeasClient() {
      this.queryMap.pageNum = 1;
      this.getTime()
      await this.findHighSeasClient();
      // this.reset();

    },
    //显示是否呼叫
    showCall(row, column) {
      let call = '';
      if (row.isCall == 0) {
        call = '未呼叫';
      } else if (row.isCall == 1) {
        call = '已呼叫';
      } else {
        call = '未呼叫';
      }
      return call;
    },
    //显示生命周期
    showLifeCycle(row, column) {
      let lifeCycle = '';
      if (row.lifeCycle == 0) {
        lifeCycle = '潜在';
      } else if (row.lifeCycle == 1) {
        lifeCycle = '签约';
      } else if (row.lifeCycle == 2) {
        lifeCycle = '重复购买';
      } else if (row.lifeCycle == 3) {
        lifeCycle = '失效';
      }
      return lifeCycle;
    },
    getTime() {
      if (this.value2 != null && this.value2.length === 2) {
        console.log("时间：", this.value2);
        // 格式化开始和结束时间
        this.queryMap.startTime = this.formatDate(this.value2[0], false); // 开始日期
        this.queryMap.endTime = this.formatDate(this.value2[1], true);    // 结束日期
      } else {
        this.queryMap.startTime = "";
        this.queryMap.endTime = "";
      }
    },
    //默认时间
    defaultTime() {
      const end = new Date();
      const start = new Date();
      start.setTime(start.getTime() - 3600 * 1000 * 24 * 2);
      end.setTime(end.getTime());
      this.value2 = [start, end]; // 重置为最近一周
      this.getTime()
    },
    //定义一个格式化时间的函数（格式为 yyyy-MM-dd）
    formatDate(date, isEnd) {
      if (date != null) {
        let formattedDate = new Date(date); // 复制一份新的日期对象，避免修改原始日期
        if (isEnd) {
          // 对结束时间加一天，以确保区间包括结束日期当天
          formattedDate.setDate(formattedDate.getDate() + 1);
        }
        const year = formattedDate.getFullYear();
        const month = ('0' + (formattedDate.getMonth() + 1)).slice(-2);
        const day = ('0' + formattedDate.getDate()).slice(-2);
        return `${year}-${month}-${day}`;
      }
      return null;
    },
    //加载用户表格
    async downExcelAll() {
      const $this = this;
      const res = axios
          .request({
            url: "http://47.99.186.44:8990/highSeasClient/excelAll",
            method: "post",
            responseType: "blob",
            headers: {'Authorization': LocalStorage.get(LOCAL_KEY_XINGUAN_ACCESS_TOKEN)},	//设置请求头
          })
          .then(res => {
            if (res.headers["content-type"] === "application/json") {
              return $this.$message.error(
                  "Subject does not have permission [user:export]"
              );
            }
            const data = res.data;
            let url = window.URL.createObjectURL(data); // 将二进制文件转化为可访问的url
            const a = document.createElement("a");
            document.body.appendChild(a);
            a.href = url;
            a.download = "公海列表.xls";
            a.click();
            window.URL.revokeObjectURL(url);
          });
    },
    //导出
    async batchExportExcel() {
      if (this.multipleSelection.length === 0) {
        return this.$message.warning('请至少选择一条记录');
      }
      const resourceIds = this.multipleSelection.map(row => row.resourceId);
      try {
        const res = await axios.request({
          url: 'http://47.99.186.44:8990/highSeasClient/excelBatch',
          method: 'post',
          responseType: 'blob',
          headers: {'Authorization': LocalStorage.get(LOCAL_KEY_XINGUAN_ACCESS_TOKEN)},
          // 直接发送resourceIds数组
          data: resourceIds
        });
        if (res.headers["content-type"] === "application/json") {
          return this.$message.error(
              "Subject does not have permission [user:export]"
          );
        }
        const data = res.data;
        let url = window.URL.createObjectURL(data);
        const a = document.createElement("a");
        document.body.appendChild(a);
        a.href = url;
        a.download = "批量导出公海列表.xls";
        a.click();
        window.URL.revokeObjectURL(url);
      } catch (error) {
        console.error('批量导出时出错', error);
        this.$message.error('批量导出时遇到异常，请检查网络或联系管理员');
      }
    },
    /**
     * 加载归属人列表
     */
    async selectUser() {
      const {data: res} = await this.$http.post("/system/departmentUtils/getUserListByMap/", {
        accountName:this.queryMap.accountName
      });
      if (res.success) {
        this.options_user = res.data;
      } else {
        return this.$message.error("系统通知信息编辑失败:" + res.message);
      }
    },

    //显示资源标签
    showTag(row, column) {
      let tag = '';
      if (row.resourceTag == 0) {
        tag = '未标记';
      } else if (row.resourceTag == 1) {
        tag = '无效';
      } else if (row.resourceTag == 2) {
        tag = '待定';
      } else if (row.resourceTag == 3) {
        tag = '有效';
      } else {
        tag = '未标记';
      }
      return tag;
    },
    showExists(row, column) {
      let value = '';
      if (row.isExists == 0) {
        value = '不存在';
      } else if (row.isExists == 1) {
        value = '已存在';
      } else {
        value = '不存在';
      }
      return value;
    },

  },
  created() {
    this.defaultTime();
    this.searchHighSeasClient();
    this.getAllIndustryList();
    this.findClienttypeList();
    this.selectUser();
    this.findCreateUsersList();
    this.getAccountNameList();
  }
};
</script>

<style scoped>
.hint {
  margin-left: 2vh;
  font-weight: 400;
  font-size: 12px;
  color: red;
}

.dataDict {
  border: none;
  background-color: #fff;
  position: absolute;
  padding: .8vh 0;
  left: 17.2vh;
  font-size: 18px;
}

.popups {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0%;
  left: 0%;
  background-color: #00000042;
  z-index: 100;
}

.popups .el-main {
  background-color: #fff;
  margin: 15vh auto;
}

.popups .el-main .header {
  display: flex;
  justify-content: center;
  margin-bottom: 2vh;
}

.popups .el-main .header button {
  flex-shrink: 0; /* 防止收缩 */
  font-size: 3vh;
  height: 4.6vh;
  border: none;
}

.el-row {
  margin-bottom: 20px;

  &:last-child {
    margin-bottom: 0;
  }
}

.el-row .el-col {
  font-size: 14px;
}

.el-row .el-col label {
  color: #5e6d82;
}
</style>